<!--
 * @Description: 
 * @LastEditors: xzh
 * @LastEditTime: 2024-05-05 20:54:55
-->
<template>
  <DileLayer
    v-model="layerParam.visible"
    layerWidth="80%"
    layerHeight="70%"
    :footerVisible="false"
  >
    <component :is="modeComponent" />
  </DileLayer>
</template>

<script setup lang="ts">
import { ref, reactive, computed } from "vue";
import { object_Inf } from "@/utils/typings/index.type";
import RepairRecord from "@/views/equipManage/equipRepair/repairRecord/index.vue";
/**
 * @Author: xzh
 * @Description: 弹框参数
 * @Param:
 */
let layerParam = reactive({
  visible: false,
  modeType: "",
  param: {},
});
/**
 * @Author: xzh
 * @Description: 初始化
 * @Param:
 * @param {*} code
 */
let init = async (modeType: string, param: object_Inf) => {
  Object.assign(layerParam, {
    visible: true,
    modeType,
    param,
  });
};
/**
 * @Author: xzh
 * @Description:
 * @Param:
 * @param {*} computed
 */
let modeComponent = computed(() => {
  let { modeType } = layerParam,
    component = null;
  switch (modeType) {
    case "repairRecord":
      component = RepairRecord;
      break;
  }

  return component;
});

defineExpose({
  init,
});
</script>
<style lang="scss" scoped></style>
